package com.oocl.chat.controller;

import java.io.ObjectOutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.HashMap;
import java.util.Map;

import com.oocl.chat.util.Constants;
import com.oocl.thread.SocketListener;


public class ChatServer {
	public ChatServer() throws Exception{
		ServerSocket server = new ServerSocket(Constants.PORT);
		System.out.println("服务器开启成功!!!");
		while(true){
			Socket socket = server.accept();
			new Thread(new SocketListener(socket)).start();
		}
	}
	
	public static void main(String[] args) throws Exception {
		new ChatServer();
	}
}
